package com.xbongbong.paas.service.stage;

import com.xbongbong.paas.pojo.dto.ExplainRelationListDTO;
import com.xbongbong.paas.pojo.dto.FormExplainListDTO;
import com.xbongbong.paas.pojo.dto.FormGetDTO;
import com.xbongbong.paas.pojo.dto.StageGetDTO;
import com.xbongbong.paas.pojo.dto.StageListDTO;
import com.xbongbong.paas.pojo.dto.StageSaveDTO;
import com.xbongbong.paas.pojo.dto.StageTitleFieldDTO;
import com.xbongbong.paas.pojo.dto.StageWorkGetDTO;
import com.xbongbong.paas.pojo.dto.StageWorkSaveDTO;
import com.xbongbong.paas.pojo.dto.StageWorkSortDTO;
import com.xbongbong.paas.pojo.dto.StageWorkflowListDTO;
import com.xbongbong.paas.pojo.dto.StartStageGetDTO;
import com.xbongbong.paas.pojo.vo.ExplainRelationListVO;
import com.xbongbong.paas.pojo.vo.LinkFormSimpleListVO;
import com.xbongbong.paas.pojo.vo.StageGetVO;
import com.xbongbong.paas.pojo.vo.StageLinkAttrVO;
import com.xbongbong.paas.pojo.vo.StageListVO;
import com.xbongbong.paas.pojo.vo.StageSaveVO;
import com.xbongbong.paas.pojo.vo.StageTitleFieldVO;
import com.xbongbong.paas.pojo.vo.StageWorkGetVO;
import com.xbongbong.paas.pojo.vo.StageWorkflowListVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.formexplain.pojo.vo.RuleFormExplainListVO;
import com.xbongbong.pro.opportunity.pojo.dto.OpportunityStageSyncDTO;
import com.xbongbong.pro.script.pojo.dto.StageSettingScriptDTO;

/**
 * 阶段设置
 * @author 李少杰
 * @version v1.0.0
 * @date 2021/11/26 11:10
 */
public interface StageSettingService {

    /**
     * 获取阶段
     * @param stageGetDTO
     * @return
     */
    StageGetVO get(StageGetDTO stageGetDTO) throws XbbException;

    /**
     * 保存阶段
     * @param stageSaveDTO
     * @return
     */
    StageSaveVO save(StageSaveDTO stageSaveDTO) throws XbbException;

    /**
     * 阶段列表(包括阶段任务)
     * @return
     */
    StageListVO list(StageListDTO stageListDTO) throws XbbException;

    /**
     * 阶段任务保存
     * @param stageWorkSaveDTO
     * @return
     * @throws XbbException
     */
    StageSaveVO stageWorkSave(StageWorkSaveDTO stageWorkSaveDTO) throws XbbException;

    /**
     * 阶段任务获取
     * @param stageWorkGetDTO
     * @return
     * @throws XbbException
     */
    StageWorkGetVO stageWorkGet(StageWorkGetDTO stageWorkGetDTO) throws XbbException;

    /**
     * 阶段任务排序
     * @param stageWorkSortDTO
     * @return
     * @throws XbbException
     */
    BaseVO stageWorkSort(StageWorkSortDTO stageWorkSortDTO) throws XbbException;

    /**
     * 设置开始阶段
     * @param stageSaveDTO
     * @return
     * @throws XbbException
     */
    StageSaveVO startSet(StageSaveDTO stageSaveDTO) throws XbbException;

    /**
     * 开始阶段数据获取
     * @param startStageGetDTO
     * @return
     * @throws XbbException
     */
    StageGetVO startGet(StartStageGetDTO startStageGetDTO) throws XbbException;

    /**
     * 阶段任务删除
     * @param stageWorkGetDTO
     * @return
     * @throws XbbException
     */
    BaseVO stageWorkDel(StageWorkGetDTO stageWorkGetDTO) throws XbbException;

    /**
     * 获取消息内容字段
     * @param stageTitleFieldDTO
     * @return
     * @throws XbbException
     */
    StageTitleFieldVO getTitleField(StageTitleFieldDTO stageTitleFieldDTO) throws XbbException;

    /**
     * 阶段比例或者任务占比变更同步销售机会数据
     * @param stageSyncDTO
     * @return
     * @throws XbbException
     */
    BaseVO syncOpportunityData(OpportunityStageSyncDTO stageSyncDTO) throws XbbException;

    /**
     * 阶段任务关联表单及解释
     * @param stageTitleFieldDTO
     * @return
     * @throws XbbException
     */
    StageLinkAttrVO getLinkAttr(StageTitleFieldDTO stageTitleFieldDTO) throws XbbException;

    /**
     * 获取当前表单的关联表单信息
     * @param formGetDTO
     * @return
     * @throws XbbException
     */
    LinkFormSimpleListVO getLinkFormList(FormGetDTO formGetDTO) throws XbbException;

    /**
     * 获取条件字段及逻辑符号
     *  from 业务规则
     * @param formExplainListDTO
     * @return
     * @throws XbbException
     */
    RuleFormExplainListVO ruleList(FormExplainListDTO formExplainListDTO) throws XbbException;

    /**
     * 表单条件字段联动查询
     *  from 业务规则
     * @param explainRelationListDTO
     * @return
     * @throws XbbException
     */
    ExplainRelationListVO relationRuleList(ExplainRelationListDTO explainRelationListDTO) throws XbbException;

    /**
     * 获取字段条件
     * @param stageTitleFieldDTO
     * @return
     * @throws XbbException
     */
    StageTitleFieldVO getFieldConditions(StageTitleFieldDTO stageTitleFieldDTO) throws XbbException;

    /**
     * Description: 阶段推进器设置获取可以选择的工作流
     * @param stageWorkflowListDTO
     * @return com.xbongbong.paas.pojo.vo.StageWorkflowListVO
     * @throws
     * @author 魏荣杰
     * @date 2022/2/9 16:44
     * @since
     */
    StageWorkflowListVO workflowList(StageWorkflowListDTO stageWorkflowListDTO) throws XbbException;

}
